Ext.define("App.activiti.editor.nbmp.view.NbmpEditor", {
    extend: 'Extend.window.EditWindow',
    alias: 'widget.NbmpEditor',
    listeners: {
        save: function (formbase, action) {
            var me = this;
            if (me.openUrl) {
                var data = me.getDatas();
                window.open(me.openUrl + "/" + action.result.data.id)
            }
        }
    },
    config: {
        entity: null,
        defaults: {
            columnWidth: 1
        },
        window: {
            title: '业务流程模型基本信息编辑',
            width: 600,
            height: 400,
            resizable: false,
            buttons: {
                saveAndEditNbmp: {
                    text: '保存&编辑流程图',
                    iconCls: 'save',
                    index: 1.5,
                    height: 30,
                    handler: function (btn, e) {
                        var me = this.up('window').form;
                        me.saveHandler();
                        me.openUrl = "/webjars/activiti/editor/index.html#/editor";
                    }
                }
            }
        }
    },
    items: [{
        xtype: 'hidden',
        name: 'id'
    }, {
        xtype: 'textfield',
        name: 'name',
        fieldLabel: '流程名称'
    }, {
        xtype: 'textfield',
        name: 'key',
        fieldLabel: 'KEY'
    }, {
        xtype: 'textarea',
        name: 'description',
        fieldLabel: '描述'
    }]
})
